package com.mcy.springbatch.listener;

import com.mcy.springbatch.entity.SysUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.core.SkipListener;
import org.springframework.stereotype.Component;

/**
 * 利用SkipListener监听Job在运行过程跳过数据的监听器
 * @author : Create By mcy
 * @date : 2019/8/25 22:48:53
 */
@Slf4j
@Component
public class SysUserDataSkipListener implements SkipListener<SysUser,SysUser> {

    @Override
    public void onSkipInRead(Throwable t) {
        log.error("在读过程跳过---->{}",t);
    }

    @Override
    public void onSkipInWrite(SysUser item, Throwable t) {
        log.error("在写过程跳过---->{}",item.toString(),t);
    }

    @Override
    public void onSkipInProcess(SysUser item, Throwable t) {
        log.error("在处理过程跳过---->{}",item.toString(),t);
    }
}
